import { FormInstance } from 'antd/es/form/Form'
import { IVariableSort, IPressure, IVariableSubmit } from '@/@types/common'

// 当前查看的类型
export enum ITYPE {
  VARIABLE = 1,
  TARGET = 2,
}

// 指标列表数据结构
export interface ITargetList {
  targetName: string
  lastValue: string
  value: string
}

export interface IVariable {
  variableList: IVariableSort[]
  formObj: FormInstance
  readonly?: boolean
}

export interface IEvent {
  eventList: IPressure[]
  eventLookHandle: (value: IPressure) => void
  readonly: boolean
  loading: boolean
  deleteHandle: (value: IPressure) => void
}

export interface ITarget {
  tableHeader: string[]
  targetList: ITargetList[]
  loading: boolean
}

// 医院基本信息
export interface IBasic {
  id: string // 数据填报id
  dataReportYear: string // 数据上报年份
  dataReportQuarter: string // 数据上报季度
  platformId: string // 平台id
  hospitalId: string // 医院id
  hospitalName: string
  wardId: string // 病区id
  status: string // 状态 0 未提交 1已提交 2 退回 3已审核
  isStaging: string // 是否暂存
  startTime: string // 上报开始时间
  endTime: string // 上报结束时间
  wardName: string
}

export interface IEventTable {
  formObj: FormInstance // form实例
  handleOk: (value: boolean) => void // 确认回调, 需要判断是直接关闭还是继续添加不关闭
  handleCancel: () => void // 取消或者关闭回调
  visible: boolean // 控制弹窗的展示和因此
  onlyLook?: boolean // 为true只读, 不可编辑
  wardList: any[]
  isEdit: boolean
}

export interface IImportVariable {
  id: string
  setImportVariable: (value: IVariableSubmit[]) => void
}
export interface IImportEvent {
  id: string
  importSuccess: () => void
}

export interface IReport {
  variableParams: IVariable
  eventParams: IEvent
  basicMsg?: IBasic
  varTargetType: ITYPE
  targetParams: ITarget
  variableTargetChange: (value: ITYPE) => void
  eventTableParams: IEventTable
  temporaryStorage: () => void
  getTemplateHandle: () => void
  setShowEventModal: (value: boolean) => void
  submitVerify: () => void
  importVariableParams: IImportVariable
  importEventParams: IImportEvent
  showCheckTarget: boolean
  readonly: boolean
  submitBtnHandle: () => void
  setShowCheckTarget: (value: boolean) => void
  needGetPressure: boolean
  setIsView: (value: boolean) => void
}
